<?php
/**
 * Created by PhpStorm.
 * @author WYZ <wyz@jungo.com.cn>
 * @copyright 深圳市俊网网络有限公司
 */

namespace Selibra\WebSocket\Annotations;

use Selibra\Di\AnnotationConfigure;
use Selibra\Di\AnnotationExecEntity;
use Selibra\Di\Annotations\Protocol\SelibraAnnotationInterface;
use Selibra\WebSocket\WebSocketServerOnStartCallbackCollector;
use \Attribute;

/**
 * Class WebSocketServerOnStart
 * @package Selibra\WebSocket\Annotations
 */
#[Attribute(Attribute::TARGET_METHOD)]
final class WebSocketServerOnStart implements SelibraAnnotationInterface
{


    /**
     * @inheritDoc
     */
    public function exec(AnnotationExecEntity &$annotationExecEntity)
    {
        // 记录
        $class = $annotationExecEntity->getClass();
        $method = $annotationExecEntity->getMethod()->getName();
        // 注册
        WebSocketServerOnStartCallbackCollector::register($class,$method);
    }

    /**
     * @inheritDoc
     */
    public function configure(AnnotationConfigure $annotationConfigure)
    {
        // TODO: Implement configure() method.
    }
}